

#include <gtest/gtest.h>

#include "Utility/Logging/SGLogger.h"

using namespace SG::Utility;

TEST (SGLoggerTest, GetInstance)
{
    SGLogger& logger1 = SGLogger::get ();
    SGLogger& logger2 = SGLogger::get ();
    EXPECT_EQ (&logger1, &logger2);
}

// TEST(SGLoggerTest, InitAndDisable) {
//     SGLogger& logger = SGLogger::get();
//     logger.init("test.log");
//     logger.trace("Test trace message");
//     //logger.disable();
//     // logger.trace("This message should not be logged");
// }

// TEST(SGLoggerTest, AddSyslogSink) {
//     SGLogger& logger = SGLogger::get();
//     logger.addSyslogSink("127.0.0.1", 514);
//     logger.error("Test error message to syslog");
// }

TEST (SGLoggerTest, LogLevels)
{
    SGLogger& logger = SGLogger::get ();
    logger.trace ("Trace message");
    logger.debug ("Debug message");
    logger.info ("Info message");
    logger.warning ("Warning message");
    logger.error ("Error message");
    logger.fatal ("Fatal message");
}

TEST (SGLoggerTest, SGLoggerTest)
{
    SGLogger& logger = SGLogger::get ();
    // logger.init ("sglogger.conf");
    // logger.addTextFileSink ("test_sink.log");

    logger.trace ("Test trace message");
    logger.debug ("Test debug message to sink");
    logger.info ("Test info message to sink");
    logger.warning ("Test warning message to sink");
    logger.error ("Test error message to sink");
    logger.fatal ("Test fatal message to sink");
}
